var taskData = require('../../data/taskList-data.js');
const app = getApp()
Page({

  /**
   * 页面的初始数据
   */
  data: {

  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    //0表示第一个tabbar  
    app.globalData.template.tabbar("tabBar", 0, this);
    this.setData({
      taskList: taskData.taskList
    });
  },

  onImgTaskList: function (event) {
    wx.navigateTo({
      url: '/pages/taskList/taskList?taskType=image'
    })
  },

  onVoiceTaskList: function (event) {
    wx.navigateTo({
      url: '/pages/taskList/taskList?taskType=voice'
    })
  },
  onTaskDetail: function (event) {
    var taskType = event.currentTarget.dataset.tasktype;
    switch (taskType) {
      case 'image':
      case 'voice':
        wx.navigateTo({
          url: '/pages/imgTaskDetail/imgTaskDetail?taskType=' + taskType
        });
        break;
      default:
        wx.showModal({
          content: '敬请期待...',
          showCancel: false
        })
        break;
    }
  },

  onTextCollection: function (event){
    wx.showModal({
      content: '敬请期待...',
      showCancel: false
    })
  },

  onVideoCapture: function (event) {
    wx.showModal({
      content: '敬请期待...',
      showCancel: false
    })
  },


  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  }
})